﻿@{
    Layout = null;
    
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width" />
    <title>填写反馈</title>
    <link href="~/Content/font-awesome.min.css" rel="stylesheet" />
    <link href="~/content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/content/wechat/basic.css" rel="stylesheet" />
    <link href="~/content/wechat/WriteFeedback.css" rel="stylesheet" />
</head>
<body>
    <header class="style-bg-green">
        <i class="fa fa-photo col-xs-10"><span class="titleX"> 请选择问题出现的场景</span></i>
    </header>
    <div class="container">
        <div class="clearfix">
            <div class="tag style-bg-green"></div>
            @*<div class="clearfix situation">
                <label for="meetingSystem" class="col-xs-4">会议系统</label>
                <p id="meetingSystem" class="col-xs-8 style-gray">
                    无法订会议、会议室
                    <i class="fa fa-angle-right style-green"></i>
                </p>

            </div>
            <div class="clearfix situation">
                <label for="accountManage" class="col-xs-4">账户管理系统</label>
                <p id="accountManage" class="col-xs-8 style-gray">
                    无法登陆邮箱、无法修改密码
                    <i class="fa fa-angle-right style-green"></i>
                </p>
            </div>
            <div class="clearfix situation">
                <label for="projectManage" class="col-xs-4">项目管理系统</label>
                <p id="projectManage" class="col-xs-8 style-gray">
                    无法修改项目状态
                    <i class="fa fa-angle-right style-green"></i>
                </p>
            </div>
            <div class="clearfix situation">
                <label for="expenseSystem" class="col-xs-4">报销系统</label>
                <p id="expenseSystem" class="col-xs-8 style-gray">
                    无法申请报销
                    <i class="fa fa-angle-right style-green"></i>
                </p>
            </div>*@
        </div>

        <!--在这里配置问题-->
        <div id="questionContainer">
            <div id="questions" class="clearfix">
                <div class="tag style-bg-green"></div>
                <div id="questionsContainer"></div>
            </div>
        </div>

    </div>
    <footer class="col-xs-12">
        <button class="return col-xs-12 style-bg-blue" id="remind">返回</button>
    </footer>

    <script src="~/scripts/jquery-1.8.2.min.js"></script>
    <script>
        $(function(){
            feedback.$Init();
        });

        var feedback = {
            $Init:function(){
                feedback.$showSituation();

                feedback.$showQuestion();
            },


            $showSituation:function(){
                var clientID = @ViewData["ClientID"];

                //获取project的信息

                var application = "";
           
                $.ajax({
                    url: "/api/WeChat/GetApplicationInfo",
                    data: { 'clientID': clientID },
                    success: function (data) {
                        $.each(data, function (j, projectItem) {
                            console.log("GetApplicationInfo :" + projectItem.Name);
                            application += "<div class=\"clearfix situation\">"
                                + "<label for="+projectItem.ID+" class=\"col-xs-4\">"+projectItem.Name+"</label>"                               
                                + "</div>";
                        });
                        $(".clearfix").append(application);
                    }
                });
            },

            $showQuestion:function(){
                var chooseQ;
                var questionHead = "<i class='fa fa-pencil col-xs-10'> 请选择您遇到的问题</i>";
                //选择问题发生情景
                $(document).on('click touchstart', "div.situation", function () {
                    console.log("div.situation : " + $(this).find("label").attr("for"));
                    location.href = "../WeChat/CreateApplication?ApplicationID=" + $(this).find("label").attr("for");
                    //var questions ="";
                    //        console.log("div.situation : " + $(this).find("label").attr("for"));
                    //        //获取issuetype信息
                    //        $.ajax({
                    //            url: "/api/Settings/GetIssueTypeInfos",
                    //            data: { 'ProjectID': $(this).find("label").attr("for") },
                    //            dataType: "json",
                    //            success: function(infos) {
                    //                $.each(infos,
                    //                    function(j, item) {
                    //                        // console.log("GetIssueTypeInfos ApplicationID :" + item.ApplicationID);
                    //                        console.log("GetIssueTypeInfos ID :" + item.ID+"   GetIssueTypeInfos IssueTypeDescription :"+item.IssueTypeDescription);
                            
                    //                        questions += "<p id=\"meetingSystem\" for ="+item.ID+">" +
                    //                            item.IssueTypeDescription + "</p>";
                    //                    });
                    //                $("#questions").html(questions); //数据填充进html进行显示
                    //                ////<!--在这里配置问题---End-->
                    //            }
                    //        });
                        
                    


                    //$("header").html(questionHead);
                    //$(".container").attr("id", "cover");
                    //$("#questionContainer").fadeIn(); //显示问题详情部分
                    //$("footer").css("display", "block");

                    ////选择相应问题
                    //$(document).on('click touchstart','#questions p',function() {
                    //    console.log("#questions p :" + $(this).attr("for"));
                    //    location.href = "../WeChat/CreateApplication?IssueTypeID="+$(this).attr("for");
                    //});

                    ////返回选择情景部分
                    //$(".return").click(function() {
                    //    feedback.$closeQuestion();
                    //});


                });
            },

            //关闭问题详情部分
            $closeQuestion:function(){
                $("#questionContainer").fadeOut();
                $(".container").removeAttr("id");
                $("footer").css("display","none");
            }
        }
        
    </script>
</body>
</html>
